package JPLXtandemGA;

import java.util.List;
import java.util.Random;

public class ParameterList implements IParameter<ParameterList> {

	private final String name;
	private final List<String> list;
	private final Random RNG = new Random();

	public ParameterList(String name, List<String> list) {
		this.list = list;
		this.name = name;
	}

	@Override
	public ParameterList mutate() {		
		return randomize();
	}

	@Override
	public String name() {
		return name;
	}

	@Override
	public ParameterList randomize(){
		int val = RNG.nextInt(list.size());
		return new ParameterList(name, list.subList(0,val));
	}

	@Override
	public String xmlRepresentation() {
		 
		return Parameters.makeNote(name, list.toString());
	}

	@Override
	public String valueToString() {
		
		return null;
	}

}
